#include <REGX52.H>
#include"Delay.h"
#include"key.h"
#include"Nixie.h"
#include"MOTOR.H"
#include"IR.h"


unsigned char COM,speed;
void main()
{
	motor_int();
	IR_INIT();
 	while(1)
	{
		if(IR_dataflag())
		{
			COM=commendflag();
			if(COM==IR_0) {speed=0;}
			if(COM==IR_1) {speed=1;}
			if(COM==IR_2) {speed=2;}
			if(COM==IR_3) {speed=3;}
			
			if(speed==0) {motor_speed(0);}
			if(speed==1) {motor_speed(50);}
			if(speed==2) {motor_speed(75);}
			if(speed==3) {motor_speed(100);}
		}
		Nixie(1,speed);
	}
}

